Skip to content

Import portable browser profile data - #229

Open
IlyaasK wants to merge 8 commits into
browser-import/03-connectorfrom
browser-import/04-profile-data
Open

Import portable browser profile data#229
IlyaasK wants to merge 8 commits into
browser-import/03-connectorfrom
browser-import/04-profile-data

Conversation

@IlyaasK

@IlyaasK IlyaasK commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

What

Extend kernel profiles import-local beyond cookies to import approved portable browser data from Chrome and Helium on macOS:

  • bookmarks, selected by default
  • browsing history from the configured --days window, selected by default
  • localStorage, selected by default with a 64 MiB review boundary
  • Chrome Web Store extension IDs, selected under the profile and organization plan limits
  • a final summary and approval before cookie/localStorage values are decrypted and uploaded

Passwords and supported TOTP seeds remain a separate Managed Auth step. IndexedDB, cache, arbitrary preferences, and extension state are intentionally excluded.

Why

A useful imported profile needs more than cookies. This keeps the moment-to-magic flow simple while preserving a portable, bounded contract and making sensitive categories visible before upload. History uses actual visits in the chosen time window instead of lifetime URL counters.

How

  • snapshot live Chromium SQLite and LevelDB data before reading
  • translate bookmarks, recent history, and localStorage into the existing portable bundle format
  • inspect only metadata before approval; export values only after selection
  • enforce the API 100,000-record, 1 MiB-record, 16/64 MiB-category, and 128 MiB-bundle limits locally
  • query stored-extension capacity and constrain non-interactive/default selection
  • preserve the existing cookies_imported JSON field while adding per-category results

Depends on kernel/kernel PR #3244 for server-side extension persistence and entitlement enforcement.

Verification

  • go test ./internal/browserimport ./cmd -count=1
  • go vet ./internal/browserimport ./cmd
  • go mod tidy -diff
  • git diff --check
  • make build
  • verified the generated help shows history enabled by default
  • exercised the LevelDB reader against the local Helium profile without exposing stored values

Note

High Risk
Reads and uploads sensitive browser data (cookies, history, localStorage) from live Chromium profiles, with new LevelDB snapshotting and a tighter 64 MiB bundle contract. Mistakes in origin filtering or size fallback could leak extra data or fail imports.

Overview
kernel profiles import-local now imports bookmarks, history (from --days, default on), and localStorage alongside cookies. Users pick categories (and storage origins over 64 MiB) from metadata, then confirm before values are exported and uploaded.

Bundles are built with BuildProfileBundle (cookies/storage/history JSONL + bookmarks JSON). Compressed size is capped at 64 MiB. If the bundle is too large, the CLI drops the largest storage origins first, then history, and asks to continue; cookies and bookmarks stay. Non-interactive runs fail instead of shrinking.

Chromium readers snapshot History SQLite and Local Storage LevelDB, keep only http(s) origins, and enforce 100k-record / 1 MiB-record / 16–64 MiB category limits. JSON output adds browser_data_imported. Dashboard connector imports history by default and forwards KERNEL_* env from launchctl.

Reviewed by Cursor Bugbot for commit 3bb2059. Bugbot is set up for automated code reviews on this repo. Configure here.

@socket-security

socket-security Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgolang/​github.com/​syndtr/​goleveldb@​v1.0.09610010075100

View full report

Comment thread cmd/browser_import_profile_data.go
Comment thread cmd/browser_import_profile_data.go
Comment thread cmd/browser_import_profile_data.go
Comment thread internal/connector/connector.go
Comment thread internal/browserimport/bundle.go
Comment thread cmd/browser_import_profile_data.go
Import bookmarks, recent history, local storage, and selected Web Store extensions alongside cookies. Keep values local until final approval, enforce the API payload bounds in the CLI, and apply extension entitlements before upload.
@IlyaasK
IlyaasK force-pushed the browser-import/04-profile-data branch from f332a7a to 3bb2059 Compare August 20, 2026 19:38

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3bb2059. Configure here.

if len(selected) > 0 {
if _, ok := selected[origin]; !ok {
continue
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty storage selection exports everything

High Severity

ExportLocalStorage treats an empty origin list as “all origins.” After the 64 MiB site picker, chooseLocalStorageSites returns the raw multi-select result with no empty or size check, so deselecting every site uploads all local storage. An oversized selection is also accepted and only fails later, after cookie values are decrypted.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3bb2059. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant